﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Boggle
{
    public class BoggleCell
    {
        public BoggleCell(string letter, int row, int column)
        {
            Letter = letter;
            Row = row;
            Column = column;
        }

        public override int GetHashCode()
        {
            return Letter.GetHashCode() ^ Row.GetHashCode() ^ Column.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            BoggleCell other = obj as BoggleCell;
            if(other == null)
            {
                return false;
            }
            else
            {
                return Letter.Equals(other.Letter) && Row.Equals(other.Row) && Column.Equals(other.Column);
            }
        }

        public override string ToString()
        {
            return Letter.ToString(CultureInfo.InvariantCulture);
        }

        public string Letter { get; private set; }
        public int Row { get; private set; }
        public int Column { get; private set; }
    }
}
